DicomObjects.NET.8.48 Documentation
DicomObjects Namespace / DicomDataSet Class / Read Method / Read(Byte[],ReadBehaviours) Method

The byte array to read

The behaviours to be used when reading this stream

Example

In This Topic
    Read(Byte[],ReadBehaviours) Method
    In This Topic
    Reads from a byte array
    Syntax
    'Declaration
     
    
    Public Overloads Sub Read( _
       ByVal Array() As System.Byte, _
       Optional ByVal Behaviour As ReadBehaviours _
    ) 
    public void Read( 
       System.byte[] Array,
       ReadBehaviours Behaviour
    )

    Parameters

    Array

    The byte array to read

    Behaviour

    The behaviours to be used when reading this stream

    Remarks
    Reads an array of bytes, which may have been written by the Write method.
    Example
    DicomDataSet ds = new DicomDataSet();
    string filename = "Dataset.dcm";
    var dicomBytes = Fi"le.ReadAllBytes(filename);
                    
    ds.Read(dicomBytes);
    ds.Read(dicomBytes, new ReadBehaviours() { CloseFilesAfterReading = true }); //optional readbehaviour overload
    Requirements

    Target Platforms: .NET CLR 4.8 or higher

    See Also